using System;
using System.ComponentModel;
using System.Data.Services.Client;
using System.Diagnostics;
using OrbitOne.CRMLyncInfoDashboard.CRM.OrganizationData;


namespace OrbitOne.CRMLyncInfoDashboard.CRM.OData
{
    [DebuggerDisplay("Lead: {Id} {FullName}")]
    public class LeadModel: IEntityModel
    {
        private readonly Lead m_lead;

        public EntityModelTypes ModelType { get { return EntityModelTypes.LeadModel; } }

        public LeadModel(Lead lead)
        {
            m_lead = lead;
        }

        public LeadModel():this(new Lead())
        {
        }

        public  Guid Id
        {
            get { return m_lead.LeadId; }
        }

        public  string DisplayText
        {
            get { return FullName; }
        }

        public int SequenceNumber
        {
            get { return 3; }
        }

        public EntitytMetadataModel Metadata { get; set; }

        public string Address1_Name
        {
            get { return m_lead.Address1_Name; }
            set { m_lead.Address1_Name = value; }
        }

        public EntityReference ContactId
        {
            get { return m_lead.ContactId; }
            set { m_lead.ContactId = value; }
        }

        public string Address1_Telephone2
        {
            get { return m_lead.Address1_Telephone2; }
            set { m_lead.Address1_Telephone2 = value; }
        }

        public string LastName
        {
            get { return m_lead.LastName; }
            set { m_lead.LastName = value; }
        }

        public string Address1_City
        {
            get { return m_lead.Address1_City; }
            set { m_lead.Address1_City = value; }
        }

        public string Address1_Telephone1
        {
            get { return m_lead.Address1_Telephone1; }
            set { m_lead.Address1_Telephone1 = value; }
        }

        public int? UTCConversionTimeZoneCode
        {
            get { return m_lead.UTCConversionTimeZoneCode; }
            set { m_lead.UTCConversionTimeZoneCode = value; }
        }

        public string Address2_Country
        {
            get { return m_lead.Address2_Country; }
            set { m_lead.Address2_Country = value; }
        }

        public double? Address2_Latitude
        {
            get { return m_lead.Address2_Latitude; }
            set { m_lead.Address2_Latitude = value; }
        }

        public DateTime? ModifiedOn
        {
            get { return m_lead.ModifiedOn; }
            set { m_lead.ModifiedOn = value; }
        }

        public string Address2_City
        {
            get { return m_lead.Address2_City; }
            set { m_lead.Address2_City = value; }
        }

        public double? EstimatedValue
        {
            get { return m_lead.EstimatedValue; }
            set { m_lead.EstimatedValue = value; }
        }

        public DateTime? LastUsedInCampaign
        {
            get { return m_lead.LastUsedInCampaign; }
            set { m_lead.LastUsedInCampaign = value; }
        }

        public string Address1_County
        {
            get { return m_lead.Address1_County; }
            set { m_lead.Address1_County = value; }
        }

        public EntityReference ModifiedBy
        {
            get { return m_lead.ModifiedBy; }
            set { m_lead.ModifiedBy = value; }
        }

        public string Address1_Line3
        {
            get { return m_lead.Address1_Line3; }
            set { m_lead.Address1_Line3 = value; }
        }

        public bool? DoNotBulkEMail
        {
            get { return m_lead.DoNotBulkEMail; }
            set { m_lead.DoNotBulkEMail = value; }
        }

        public OptionSetValue StateCode
        {
            get { return m_lead.StateCode; }
            set { m_lead.StateCode = value; }
        }

        public DateTime? EstimatedCloseDate
        {
            get { return m_lead.EstimatedCloseDate; }
            set { m_lead.EstimatedCloseDate = value; }
        }

        public OptionSetValue Address2_AddressTypeCode
        {
            get { return m_lead.Address2_AddressTypeCode; }
            set { m_lead.Address2_AddressTypeCode = value; }
        }

        public OptionSetValue LeadSourceCode
        {
            get { return m_lead.LeadSourceCode; }
            set { m_lead.LeadSourceCode = value; }
        }

        public OptionSetValue Address2_ShippingMethodCode
        {
            get { return m_lead.Address2_ShippingMethodCode; }
            set { m_lead.Address2_ShippingMethodCode = value; }
        }

        public string orb_lyncsearchfield
        {
            get { return m_lead.orb_lyncsearchfield; }
            set { m_lead.orb_lyncsearchfield = value; }
        }

        public string Address2_Name
        {
            get { return m_lead.Address2_Name; }
            set { m_lead.Address2_Name = value; }
        }

        public Money EstimatedAmount_Base
        {
            get { return m_lead.EstimatedAmount_Base; }
            set { m_lead.EstimatedAmount_Base = value; }
        }

        public string Telephone1
        {
            get { return m_lead.Telephone1; }
            set { m_lead.Telephone1 = value; }
        }

        public string Description
        {
            get { return m_lead.Description; }
            set { m_lead.Description = value; }
        }

        public OptionSetValue IndustryCode
        {
            get { return m_lead.IndustryCode; }
            set { m_lead.IndustryCode = value; }
        }

        public string Telephone3
        {
            get { return m_lead.Telephone3; }
            set { m_lead.Telephone3 = value; }
        }

        public string Address1_Country
        {
            get { return m_lead.Address1_Country; }
            set { m_lead.Address1_Country = value; }
        }

        public string MiddleName
        {
            get { return m_lead.MiddleName; }
            set { m_lead.MiddleName = value; }
        }

        public EntityReference CustomerId
        {
            get { return m_lead.CustomerId; }
            set { m_lead.CustomerId = value; }
        }

        public decimal? ExchangeRate
        {
            get { return m_lead.ExchangeRate; }
            set { m_lead.ExchangeRate = value; }
        }

        public DateTime? OverriddenCreatedOn
        {
            get { return m_lead.OverriddenCreatedOn; }
            set { m_lead.OverriddenCreatedOn = value; }
        }

        public string MobilePhone
        {
            get { return m_lead.MobilePhone; }
            set { m_lead.MobilePhone = value; }
        }

        public string Fax
        {
            get { return m_lead.Fax; }
            set { m_lead.Fax = value; }
        }

        public bool? ParticipatesInWorkflow
        {
            get { return m_lead.ParticipatesInWorkflow; }
            set { m_lead.ParticipatesInWorkflow = value; }
        }

        public DateTime? CreatedOn
        {
            get { return m_lead.CreatedOn; }
            set { m_lead.CreatedOn = value; }
        }

        public EntityReference AccountId
        {
            get { return m_lead.AccountId; }
            set { m_lead.AccountId = value; }
        }

        public string SIC
        {
            get { return m_lead.SIC; }
            set { m_lead.SIC = value; }
        }

        public EntityReference OwnerId
        {
            get { return m_lead.OwnerId; }
            set { m_lead.OwnerId = value; }
        }

        public double? Address1_Longitude
        {
            get { return m_lead.Address1_Longitude; }
            set { m_lead.Address1_Longitude = value; }
        }

        public string Address1_UPSZone
        {
            get { return m_lead.Address1_UPSZone; }
            set { m_lead.Address1_UPSZone = value; }
        }
        
        public string YomiCompanyName
        {
            get { return m_lead.YomiCompanyName; }
            set { m_lead.YomiCompanyName = value; }
        }

        public EntityReference CreatedOnBehalfBy
        {
            get { return m_lead.CreatedOnBehalfBy; }
            set { m_lead.CreatedOnBehalfBy = value; }
        }

        public string EMailAddress1
        {
            get { return m_lead.EMailAddress1; }
            set { m_lead.EMailAddress1 = value; }
        }

        public string YomiFirstName
        {
            get { return m_lead.YomiFirstName; }
            set { m_lead.YomiFirstName = value; }
        }

        public string Address1_StateOrProvince
        {
            get { return m_lead.Address1_StateOrProvince; }
            set { m_lead.Address1_StateOrProvince = value; }
        }

        public string EMailAddress2
        {
            get { return m_lead.EMailAddress2; }
            set { m_lead.EMailAddress2 = value; }
        }

        public string Address1_PostOfficeBox
        {
            get { return m_lead.Address1_PostOfficeBox; }
            set { m_lead.Address1_PostOfficeBox = value; }
        }

        public bool? DoNotFax
        {
            get { return m_lead.DoNotFax; }
            set { m_lead.DoNotFax = value; }
        }

        public long? VersionNumber
        {
            get { return m_lead.VersionNumber; }
            set { m_lead.VersionNumber = value; }
        }

        public string Address2_Line3
        {
            get { return m_lead.Address2_Line3; }
            set { m_lead.Address2_Line3 = value; }
        }

        public string Address2_Line1
        {
            get { return m_lead.Address2_Line1; }
            set { m_lead.Address2_Line1 = value; }
        }

        public string Address1_Line1
        {
            get { return m_lead.Address1_Line1; }
            set { m_lead.Address1_Line1 = value; }
        }

        public int? NumberOfEmployees
        {
            get { return m_lead.NumberOfEmployees; }
            set { m_lead.NumberOfEmployees = value; }
        }

        public string CompanyName
        {
            get { return m_lead.CompanyName; }
            set { m_lead.CompanyName = value; }
        }

        public string FullName
        {
            get { return m_lead.FullName; }
            set { m_lead.FullName = value; }
        }

        public double? Address2_Longitude
        {
            get { return m_lead.Address2_Longitude; }
            set { m_lead.Address2_Longitude = value; }
        }

        public string FirstName
        {
            get { return m_lead.FirstName; }
            set { m_lead.FirstName = value; }
        }

        public double? Address1_Latitude
        {
            get { return m_lead.Address1_Latitude; }
            set { m_lead.Address1_Latitude = value; }
        }

        public Money EstimatedAmount
        {
            get { return m_lead.EstimatedAmount; }
            set { m_lead.EstimatedAmount = value; }
        }

        public EntityReference MasterId
        {
            get { return m_lead.MasterId; }
            set { m_lead.MasterId = value; }
        }

        public string Address2_Fax
        {
            get { return m_lead.Address2_Fax; }
            set { m_lead.Address2_Fax = value; }
        }

        public string Telephone2
        {
            get { return m_lead.Telephone2; }
            set { m_lead.Telephone2 = value; }
        }

        public string Address2_Telephone1
        {
            get { return m_lead.Address2_Telephone1; }
            set { m_lead.Address2_Telephone1 = value; }
        }

        public string Address2_UPSZone
        {
            get { return m_lead.Address2_UPSZone; }
            set { m_lead.Address2_UPSZone = value; }
        }

        public string Address1_Telephone3
        {
            get { return m_lead.Address1_Telephone3; }
            set { m_lead.Address1_Telephone3 = value; }
        }

        public OptionSetValue PreferredContactMethodCode
        {
            get { return m_lead.PreferredContactMethodCode; }
            set { m_lead.PreferredContactMethodCode = value; }
        }

        public string Address2_Line2
        {
            get { return m_lead.Address2_Line2; }
            set { m_lead.Address2_Line2 = value; }
        }

        public string WebSiteUrl
        {
            get { return m_lead.WebSiteUrl; }
            set { m_lead.WebSiteUrl = value; }
        }

        public string Address2_PostalCode
        {
            get { return m_lead.Address2_PostalCode; }
            set { m_lead.Address2_PostalCode = value; }
        }

        public OptionSetValue Address1_ShippingMethodCode
        {
            get { return m_lead.Address1_ShippingMethodCode; }
            set { m_lead.Address1_ShippingMethodCode = value; }
        }

        public EntityReference OwningUser
        {
            get { return m_lead.OwningUser; }
            set { m_lead.OwningUser = value; }
        }

        public string YomiFullName
        {
            get { return m_lead.YomiFullName; }
            set { m_lead.YomiFullName = value; }
        }

        public Guid? Address2_AddressId
        {
            get { return m_lead.Address2_AddressId; }
            set { m_lead.Address2_AddressId = value; }
        }

        public string Pager
        {
            get { return m_lead.Pager; }
            set { m_lead.Pager = value; }
        }

        public bool? DoNotSendMM
        {
            get { return m_lead.DoNotSendMM; }
            set { m_lead.DoNotSendMM = value; }
        }

        public EntityReference OwningBusinessUnit
        {
            get { return m_lead.OwningBusinessUnit; }
            set { m_lead.OwningBusinessUnit = value; }
        }

        public EntityReference CreatedBy
        {
            get { return m_lead.CreatedBy; }
            set { m_lead.CreatedBy = value; }
        }

        public Guid? Address1_AddressId
        {
            get { return m_lead.Address1_AddressId; }
            set { m_lead.Address1_AddressId = value; }
        }

        public string Address2_Telephone2
        {
            get { return m_lead.Address2_Telephone2; }
            set { m_lead.Address2_Telephone2 = value; }
        }

        public string Address1_Fax
        {
            get { return m_lead.Address1_Fax; }
            set { m_lead.Address1_Fax = value; }
        }

        public string Salutation
        {
            get { return m_lead.Salutation; }
            set { m_lead.Salutation = value; }
        }

        public OptionSetValue LeadQualityCode
        {
            get { return m_lead.LeadQualityCode; }
            set { m_lead.LeadQualityCode = value; }
        }

        public bool? DoNotEMail
        {
            get { return m_lead.DoNotEMail; }
            set { m_lead.DoNotEMail = value; }
        }

        public string YomiMiddleName
        {
            get { return m_lead.YomiMiddleName; }
            set { m_lead.YomiMiddleName = value; }
        }

        public int? TimeZoneRuleVersionNumber
        {
            get { return m_lead.TimeZoneRuleVersionNumber; }
            set { m_lead.TimeZoneRuleVersionNumber = value; }
        }

        public OptionSetValue SalesStageCode
        {
            get { return m_lead.SalesStageCode; }
            set { m_lead.SalesStageCode = value; }
        }

        public string Address1_PostalCode
        {
            get { return m_lead.Address1_PostalCode; }
            set { m_lead.Address1_PostalCode = value; }
        }

        public OptionSetValue PriorityCode
        {
            get { return m_lead.PriorityCode; }
            set { m_lead.PriorityCode = value; }
        }

        public string EMailAddress3
        {
            get { return m_lead.EMailAddress3; }
            set { m_lead.EMailAddress3 = value; }
        }

        public OptionSetValue StatusCode
        {
            get { return m_lead.StatusCode; }
            set { m_lead.StatusCode = value; }
        }

        public string YomiLastName
        {
            get { return m_lead.YomiLastName; }
            set { m_lead.YomiLastName = value; }
        }

        public EntityReference ModifiedOnBehalfBy
        {
            get { return m_lead.ModifiedOnBehalfBy; }
            set { m_lead.ModifiedOnBehalfBy = value; }
        }

        public int? Address1_UTCOffset
        {
            get { return m_lead.Address1_UTCOffset; }
            set { m_lead.Address1_UTCOffset = value; }
        }

        public EntityReference TransactionCurrencyId
        {
            get { return m_lead.TransactionCurrencyId; }
            set { m_lead.TransactionCurrencyId = value; }
        }

        public string Subject
        {
            get { return m_lead.Subject; }
            set { m_lead.Subject = value; }
        }

        public Money Revenue
        {
            get { return m_lead.Revenue; }
            set { m_lead.Revenue = value; }
        }

        public bool? Merged
        {
            get { return m_lead.Merged; }
            set { m_lead.Merged = value; }
        }

        public bool? DoNotPhone
        {
            get { return m_lead.DoNotPhone; }
            set { m_lead.DoNotPhone = value; }
        }

        public string Address2_StateOrProvince
        {
            get { return m_lead.Address2_StateOrProvince; }
            set { m_lead.Address2_StateOrProvince = value; }
        }

        public EntityReference OwningTeam
        {
            get { return m_lead.OwningTeam; }
            set { m_lead.OwningTeam = value; }
        }

        public OptionSetValue Address1_AddressTypeCode
        {
            get { return m_lead.Address1_AddressTypeCode; }
            set { m_lead.Address1_AddressTypeCode = value; }
        }

        public string Address2_PostOfficeBox
        {
            get { return m_lead.Address2_PostOfficeBox; }
            set { m_lead.Address2_PostOfficeBox = value; }
        }

        public bool? DoNotPostalMail
        {
            get { return m_lead.DoNotPostalMail; }
            set { m_lead.DoNotPostalMail = value; }
        }

        public int? Address2_UTCOffset
        {
            get { return m_lead.Address2_UTCOffset; }
            set { m_lead.Address2_UTCOffset = value; }
        }

        public EntityReference CampaignId
        {
            get { return m_lead.CampaignId; }
            set { m_lead.CampaignId = value; }
        }

        public string Address2_Telephone3
        {
            get { return m_lead.Address2_Telephone3; }
            set { m_lead.Address2_Telephone3 = value; }
        }

        public string Address1_Line2
        {
            get { return m_lead.Address1_Line2; }
            set { m_lead.Address1_Line2 = value; }
        }

        public string JobTitle
        {
            get { return m_lead.JobTitle; }
            set { m_lead.JobTitle = value; }
        }

        public int? ImportSequenceNumber
        {
            get { return m_lead.ImportSequenceNumber; }
            set { m_lead.ImportSequenceNumber = value; }
        }

        public string Address2_County
        {
            get { return m_lead.Address2_County; }
            set { m_lead.Address2_County = value; }
        }

        public Money Revenue_Base
        {
            get { return m_lead.Revenue_Base; }
            set { m_lead.Revenue_Base = value; }
        }


        public override string ToString()
        {
            return string.Format("{0}: {1}", Id, FullName);
        }
    }
}